nvis_children += 1;
}
- if (priv->center_widget != NULL)
+ if (priv->center_widget != NULL &&
+ gtk_widget_get_visible (priv->center_widget))
{
if (add_child_size (priv->center_widget, orientation, &minimum, &natural))
nvis_children += 1;
GtkRequestedSize *sizes;
gint width, height;
gint nvis_children;
- gint center_minimum_size;
- gint center_natural_size;
gint start_width, end_width;
gint side[2];
GList *l;
gint child_size;
GtkTextDirection direction;
GtkBorder css_borders;
+ gint center_minimum_size;
+ gint center_natural_size;
gtk_widget_set_allocation (widget, allocation);
i++;
}
- if (priv->center_widget)
+ if (priv->center_widget != NULL &&
+ gtk_widget_get_visible (priv->center_widget))
{
gtk_widget_get_preferred_width_for_height (priv->center_widget,
height,
¢er_minimum_size,
¢er_natural_size);
+ width -= center_natural_size;
+ }
+ else
+ {
+ center_minimum_size = 0;
+ center_natural_size = 0;
}
-
- width -= center_natural_size;
start_width = 0;
end_width = 0;
if (direction == GTK_TEXT_DIR_RTL)
child_allocation.x = allocation->x + allocation->width - (child_allocation.x - allocation->x) - child_allocation.width;
- if (priv->center_widget)
+ if (priv->center_widget &&
+ gtk_widget_get_visible (priv->center_widget))
gtk_widget_size_allocate (priv->center_widget, &child_allocation);
}
gtk_widget_set_parent (priv->center_widget, GTK_WIDGET (bar));
gtk_widget_set_valign (priv->center_widget, GTK_ALIGN_CENTER);
- gtk_widget_show (center_widget);
}
gtk_widget_queue_resize (GTK_WIDGET (bar));